import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'umeng_analytics_plugin_platform_interface.dart';

/// An implementation of [UmengAnalyticsPluginPlatform] that uses method channels.
class MethodChannelUmengAnalyticsPlugin extends UmengAnalyticsPluginPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('umeng_analytics_plugin');

  @override
  Future<String> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod('getPlatformVersion');
    return version?.toString() ?? '';
  }
}
